home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / MPW / Examples / ToolServer Examples / Quit•ToolServer < prev    next >
Encoding:
Text File  |  1998-12-03  |  889 b   |  30 lines  |  [TEXT/MPS ]

  1. #     Quit•ToolServer
  2. #
  3. #    Copyright Apple Computer, Inc. 1991
  4. #    All Rights Reserved.
  5. #
  6. # This is a sample Quit script for the MPW Shell.  It helps manage
  7. # the shell's relationship with ToolServer.  It should be used in
  8. # conjunction with the UserStartup•ToolServer script.
  9. #
  10. # The following if statement checks that no RShell requests
  11. # are pending before exiting the shell.  The -status option will
  12. # return no output when no requests are pending.  We use ``...``
  13. # to insure that quotes within the output of the rshell command 
  14. # are escaped properly.
  15.  
  16. If "``rshell -status``"
  17.     set exit 0
  18.     confirm "You have RShell requests that have not yet completed.  Really Quit?" -t 
  19.     If {status} != 0 
  20.         exit "-9"
  21.     End
  22.     set exit 1
  23. End
  24.  
  25. # The following will send a quit to the ToolServer if it's running locally.
  26.  
  27. If {ToolServerStarted} && "{WhichToolServer}" == "-b"
  28.     RShell {WhichToolServer} -q
  29. End
  30.